//
//  HaveTitleHotRecommendTableViewCell.m
//  TestApplication
//
//  Created by Hanlingyu on 16/8/31.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "HaveTitleHotRecommendTableViewCell.h"
#import "Masonry.h"
#import "Recommend.h"
#import "TAMacro.h"
#import "UIView+Frame.h"
@interface HaveTitleHotRecommendTableViewCell ()
@property (nonatomic, strong) UILabel *sectionLabel;

@end

@implementation HaveTitleHotRecommendTableViewCell




- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _sectionLabel = [[UILabel alloc] init];
        _sectionLabel.backgroundColor = [UIColor colorWithWhite:0.917 alpha:1.000];
        _sectionLabel.font = [UIFont systemFontOfSize:14];
        _sectionLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:_sectionLabel];

        
    }
    return self;
}



- (void)layoutSubviews {
    [super layoutSubviews];
    
    _sectionLabel.frame = CGRectMake(20, 0, SCREEN_WIDTH - 40, 30);
    self.backView.frame = CGRectMake(10, 30, SCREEN_WIDTH - 20, self.contentView.ltq_height - 30);
    
    
}

- (void)layoutIfNeeded {
    [super layoutIfNeeded];
    
    
//    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_equalTo(self.contentView).mas_offset(10);
//        make.top.mas_equalTo(_sectionLabel.mas_bottom).mas_equalTo(5);
//        make.right.bottom.mas_equalTo(self.contentView).mas_equalTo(-10);
//    }];

    
}

- (void)setRecommend:(Recommend *)recommend {
    [super setRecommend:recommend];
    _sectionLabel.text = recommend.title;
    [self.cellHeightDelegate heigthOfCell:400];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
